<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Demo extends CI_Controller {

    public function __construct() {
        parent::__construct();
        $this->load->helper('url');
        $this->load->helper('file');
        $this->load->database();
    }

    public function index($style_id=1,$module_width=750) {
		
		if( !is_numeric($style_id)){
				$style_id = 1;
			}
//		if( $module_width != 750 || $module_width != 950 || $module_width != 190){
//				$module_width = 750;
//			}
			
		$data['shop_id'] = $shop_id = '34905576';
		$data['width'] = $module_width;
		
		$this->db->where('shop_id',$shop_id);
		$user = $this->db->get('user');
		$code = $this->db->get('wallcode');
		
		if($user->num_rows() > 0) :
			$user = $user->row_array();
			$user_id = $user['user_id'];
			
			$data['configseting'] = array(
											'style_id' => $style_id,
											'min_txt_num' => 5,
											'visual' => 1,
											'intervall' => 50
										);
			
/*			$this->db->where('user_id',$user_id);
			$config = $this->db->get('config');
			if($config->num_rows() > 0){
					$data['configseting'] = $config->row_array();
				}else{
					$data['configseting'] = array(
											'style_id' => $style_id,
											'min_txt_num' => 5,
											'visual' => 1,
											'intervall' => 50
										);
				}
			*/
			
			if($code->num_rows() > 0){
				$wallcode = $code->row_array();
				$data["commnetwall"] = unserialize($wallcode['codearray']);
				$this->load->view('demo_view',$data);
			}else{
				$this->load->view('welcome_message',$data);
			}
		else : 
			$this->load->view('welcome_message',$data);
		endif;
    }


}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */
//http://100.ipropre.com/index.php/front?top_appkey=12481890&module_width=750&envMode=prod&shop_id=34905576&seller_nick=幻想de味道